package com.klb.model;

import javax.persistence.*;

/**
 * Created by fujia on 2016/7/2.
 */
@Entity
@Table(name = "bbs_friend", schema = "knowlogebase", catalog = "")
public class BbsFriend {
    private int friendId;
    private int sendId;
    private int acceptId;
    private int agree;

    @Id
    @Column(name = "friend_id", nullable = false)
    public int getFriendId() {
        return friendId;
    }

    public void setFriendId(int friendId) {
        this.friendId = friendId;
    }

    @Basic
    @Column(name = "send_id", nullable = false)
    public int getSendId() {
        return sendId;
    }

    public void setSendId(int sendId) {
        this.sendId = sendId;
    }

    @Basic
    @Column(name = "accept_id", nullable = false)
    public int getAcceptId() {
        return acceptId;
    }

    public void setAcceptId(int acceptId) {
        this.acceptId = acceptId;
    }

    @Basic
    @Column(name = "agree", nullable = false)
    public int getAgree() {
        return agree;
    }

    public void setAgree(int agree) {
        this.agree = agree;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;

        BbsFriend bbsFriend = (BbsFriend) object;

        if (friendId != bbsFriend.friendId) return false;
        if (sendId != bbsFriend.sendId) return false;
        if (acceptId != bbsFriend.acceptId) return false;
        if (agree != bbsFriend.agree) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = friendId;
        result = 31 * result + sendId;
        result = 31 * result + acceptId;
        result = 31 * result + agree;
        return result;
    }
}
